/**
 * Created by Channing on 2014/9/17.
 */
class Common{
    public static createBitmapByName(name: string): egret.Bitmap {
        let result = new egret.Bitmap();
        let texture: egret.Texture = RES.getRes(name);
        result.texture = texture;        
        return result;
    }

    public static log(str){
        if(DEBUG)
        {
            console.log(str);
        }
    }
}

class GameOver extends egret.Event
{
    public static OVER:string = "gameover";
    public distance:number = 0;
    public x:number = 0;

    public constructor(type:string, bubbles:boolean=false, cancelable:boolean=false)
    {
        super(type,bubbles,cancelable);
    }
}

class StageMove extends egret.Event
{
    public static Move:string = "move";
    public static Stop:string = "stop";
    public distance:number = 0;
    public totalDistance:number = 0;

    public constructor(type:string, bubbles:boolean=false, cancelable:boolean=false)
    {
        super(type,bubbles,cancelable);
    }
}